// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   YouTube Reporting API Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/youtube/reporting/v1/reports/'>YouTube Reporting API</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20170319 (808)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/youtube/reporting/v1/reports/'>
 *              https://developers.google.com/youtube/reporting/v1/reports/</a>
 *      <tr><th>Discovery Name<td>youtubereporting
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using YouTube Reporting API can be found at
 * <a href='https://developers.google.com/youtube/reporting/v1/reports/'>https://developers.google.com/youtube/reporting/v1/reports/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.YouTubeReporting.v1
{
    /// <summary>The YouTubeReporting Service.</summary>
    public class YouTubeReportingService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public YouTubeReportingService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public YouTubeReportingService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            jobs = new JobsResource(this);
            media = new MediaResource(this);
            reportTypes = new ReportTypesResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "youtubereporting"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://youtubereporting.googleapis.com/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return ""; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the YouTube Reporting API.</summary>
        public class Scope
        {
            /// <summary>View monetary and non-monetary YouTube Analytics reports for your YouTube content</summary>
            public static string YtAnalyticsMonetaryReadonly = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";

            /// <summary>View YouTube Analytics reports for your YouTube content</summary>
            public static string YtAnalyticsReadonly = "https://www.googleapis.com/auth/yt-analytics.readonly";

        }



        private readonly JobsResource jobs;

        /// <summary>Gets the Jobs resource.</summary>
        public virtual JobsResource Jobs
        {
            get { return jobs; }
        }

        private readonly MediaResource media;

        /// <summary>Gets the Media resource.</summary>
        public virtual MediaResource Media
        {
            get { return media; }
        }

        private readonly ReportTypesResource reportTypes;

        /// <summary>Gets the ReportTypes resource.</summary>
        public virtual ReportTypesResource ReportTypes
        {
            get { return reportTypes; }
        }
    }

    ///<summary>A base abstract class for YouTubeReporting requests.</summary>
    public abstract class YouTubeReportingBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new YouTubeReportingBaseServiceRequest instance.</summary>
        protected YouTubeReportingBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>V1 error format.</summary>
        [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }

        /// <summary>V1 error format.</summary>
        public enum XgafvEnum
        {
            /// <summary>v1 error format</summary>
            [Google.Apis.Util.StringValueAttribute("1")]
            Value1,
            /// <summary>v2 error format</summary>
            [Google.Apis.Util.StringValueAttribute("2")]
            Value2,
        }

        /// <summary>OAuth access token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string AccessToken { get; set; }

        /// <summary>Data format for response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Media download with context-dependent Content-Type</summary>
            [Google.Apis.Util.StringValueAttribute("media")]
            Media,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>OAuth bearer token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("bearer_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string BearerToken { get; set; }

        /// <summary>JSONP</summary>
        [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Callback { get; set; }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Pretty-print response.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("pp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> Pp { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadType { get; set; }

        /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadProtocol { get; set; }

        /// <summary>Initializes YouTubeReporting parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "$.xgafv", new Google.Apis.Discovery.Parameter
                {
                    Name = "$.xgafv",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "access_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "access_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "bearer_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "bearer_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "callback", new Google.Apis.Discovery.Parameter
                {
                    Name = "callback",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "pp", new Google.Apis.Discovery.Parameter
                {
                    Name = "pp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "uploadType", new Google.Apis.Discovery.Parameter
                {
                    Name = "uploadType",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "upload_protocol", new Google.Apis.Discovery.Parameter
                {
                    Name = "upload_protocol",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "jobs" collection of methods.</summary>
    public class JobsResource
    {
        private const string Resource = "jobs";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public JobsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            reports = new ReportsResource(service);

        }

        private readonly ReportsResource reports;

        /// <summary>Gets the Reports resource.</summary>
        public virtual ReportsResource Reports
        {
            get { return reports; }
        }

        /// <summary>The "reports" collection of methods.</summary>
        public class ReportsResource
        {
            private const string Resource = "reports";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public ReportsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Gets the metadata of a specific report.</summary>
            /// <param name="jobId">The ID of the job.</param>
            /// <param name="reportId">The ID of the report to
            /// retrieve.</param>
            public virtual GetRequest Get(string jobId, string reportId)
            {
                return new GetRequest(service, jobId, reportId);
            }

            /// <summary>Gets the metadata of a specific report.</summary>
            public class GetRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.Report>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string jobId, string reportId)
                    : base(service)
                {
                    JobId = jobId;
                    ReportId = reportId;
                    InitParameters();
                }


                /// <summary>The ID of the job.</summary>
                [Google.Apis.Util.RequestParameterAttribute("jobId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string JobId { get; private set; }

                /// <summary>The ID of the report to retrieve.</summary>
                [Google.Apis.Util.RequestParameterAttribute("reportId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string ReportId { get; private set; }

                /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user
                /// is acting for himself (his own channel).</summary>
                [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string OnBehalfOfContentOwner { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/jobs/{jobId}/reports/{reportId}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "jobId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "jobId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "reportId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "reportId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                        {
                            Name = "onBehalfOfContentOwner",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist.</summary>
            /// <param name="jobId">The ID of the job.</param>
            public virtual ListRequest List(string jobId)
            {
                return new ListRequest(service, jobId);
            }

            /// <summary>Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist.</summary>
            public class ListRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.ListReportsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string jobId)
                    : base(service)
                {
                    JobId = jobId;
                    InitParameters();
                }


                /// <summary>The ID of the job.</summary>
                [Google.Apis.Util.RequestParameterAttribute("jobId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string JobId { get; private set; }

                /// <summary>If set, only reports created after the specified date/time are returned.</summary>
                [Google.Apis.Util.RequestParameterAttribute("createdAfter", Google.Apis.Util.RequestParameterType.Query)]
                public virtual object CreatedAfter { get; set; }

                /// <summary>If set, only reports whose start time is greater than or equal the specified date/time are
                /// returned.</summary>
                [Google.Apis.Util.RequestParameterAttribute("startTimeAtOrAfter", Google.Apis.Util.RequestParameterType.Query)]
                public virtual object StartTimeAtOrAfter { get; set; }

                /// <summary>A token identifying a page of results the server should return. Typically, this is the
                /// value of ListReportsResponse.next_page_token returned in response to the previous call to the
                /// `ListReports` method.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Requested page size. Server may return fewer report types than requested. If unspecified,
                /// server will pick an appropriate default.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }

                /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user
                /// is acting for himself (his own channel).</summary>
                [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string OnBehalfOfContentOwner { get; set; }

                /// <summary>If set, only reports whose start time is smaller than the specified date/time are
                /// returned.</summary>
                [Google.Apis.Util.RequestParameterAttribute("startTimeBefore", Google.Apis.Util.RequestParameterType.Query)]
                public virtual object StartTimeBefore { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/jobs/{jobId}/reports"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "jobId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "jobId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "createdAfter", new Google.Apis.Discovery.Parameter
                        {
                            Name = "createdAfter",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "startTimeAtOrAfter", new Google.Apis.Discovery.Parameter
                        {
                            Name = "startTimeAtOrAfter",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                        {
                            Name = "onBehalfOfContentOwner",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "startTimeBefore", new Google.Apis.Discovery.Parameter
                        {
                            Name = "startTimeBefore",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }

        /// <summary>Creates a job and returns it.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual CreateRequest Create(Google.Apis.YouTubeReporting.v1.Data.Job body)
        {
            return new CreateRequest(service, body);
        }

        /// <summary>Creates a job and returns it.</summary>
        public class CreateRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.Job>
        {
            /// <summary>Constructs a new Create request.</summary>
            public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.YouTubeReporting.v1.Data.Job body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }


            /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user is
            /// acting for himself (his own channel).</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.YouTubeReporting.v1.Data.Job Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "create"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/jobs"; }
            }

            /// <summary>Initializes Create parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Deletes a job.</summary>
        /// <param name="jobId">The ID of the job to delete.</param>
        public virtual DeleteRequest Delete(string jobId)
        {
            return new DeleteRequest(service, jobId);
        }

        /// <summary>Deletes a job.</summary>
        public class DeleteRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.Empty>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string jobId)
                : base(service)
            {
                JobId = jobId;
                InitParameters();
            }


            /// <summary>The ID of the job to delete.</summary>
            [Google.Apis.Util.RequestParameterAttribute("jobId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string JobId { get; private set; }

            /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user is
            /// acting for himself (his own channel).</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/jobs/{jobId}"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "jobId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "jobId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Gets a job.</summary>
        /// <param name="jobId">The ID of the job to retrieve.</param>
        public virtual GetRequest Get(string jobId)
        {
            return new GetRequest(service, jobId);
        }

        /// <summary>Gets a job.</summary>
        public class GetRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.Job>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string jobId)
                : base(service)
            {
                JobId = jobId;
                InitParameters();
            }


            /// <summary>The ID of the job to retrieve.</summary>
            [Google.Apis.Util.RequestParameterAttribute("jobId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string JobId { get; private set; }

            /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user is
            /// acting for himself (his own channel).</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/jobs/{jobId}"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "jobId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "jobId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Lists jobs.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Lists jobs.</summary>
        public class ListRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.ListJobsResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }


            /// <summary>A token identifying a page of results the server should return. Typically, this is the value of
            /// ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListJobs`
            /// method.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>If set to true, also system-managed jobs will be returned; otherwise only user-created jobs
            /// will be returned. System-managed jobs can neither be modified nor deleted.</summary>
            [Google.Apis.Util.RequestParameterAttribute("includeSystemManaged", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<bool> IncludeSystemManaged { get; set; }

            /// <summary>Requested page size. Server may return fewer jobs than requested. If unspecified, server will
            /// pick an appropriate default.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> PageSize { get; set; }

            /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user is
            /// acting for himself (his own channel).</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/jobs"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "includeSystemManaged", new Google.Apis.Discovery.Parameter
                    {
                        Name = "includeSystemManaged",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageSize", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageSize",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "media" collection of methods.</summary>
    public class MediaResource
    {
        private const string Resource = "media";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public MediaResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Method for media download. Download is supported on the URI
        /// `/v1/media/{+name}?alt=media`.</summary>
        /// <param name="resourceName">Name of the media that is being downloaded.  See ReadRequest.resource_name.</param>
        public virtual DownloadRequest Download(string resourceName)
        {
            return new DownloadRequest(service, resourceName);
        }

        /// <summary>Method for media download. Download is supported on the URI
        /// `/v1/media/{+name}?alt=media`.</summary>
        public class DownloadRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.Media>
        {
            /// <summary>Constructs a new Download request.</summary>
            public DownloadRequest(Google.Apis.Services.IClientService service, string resourceName)
                : base(service)
            {
                ResourceName = resourceName;
                MediaDownloader = new Google.Apis.Download.MediaDownloader(service);
                InitParameters();
            }


            /// <summary>Name of the media that is being downloaded.  See ReadRequest.resource_name.</summary>
            [Google.Apis.Util.RequestParameterAttribute("resourceName", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string ResourceName { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "download"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/media/{+resourceName}"; }
            }

            /// <summary>Initializes Download parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "resourceName", new Google.Apis.Discovery.Parameter
                    {
                        Name = "resourceName",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = @"^.+$",
                    });
            }

            /// <summary>Gets the media downloader.</summary>
            public Google.Apis.Download.IMediaDownloader MediaDownloader { get; private set; }

            /// <summary>Synchronously download the media into the given stream.</summary>
            public virtual void Download(System.IO.Stream stream)
            {
                MediaDownloader.Download(this.GenerateRequestUri(), stream);
            }

            /// <summary>Asynchronously download the media into the given stream.</summary>
            public virtual System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress> DownloadAsync(System.IO.Stream stream)
            {
                return MediaDownloader.DownloadAsync(this.GenerateRequestUri(), stream);
            }

            /// <summary>Asynchronously download the media into the given stream.</summary>
            public virtual System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress> DownloadAsync(System.IO.Stream stream,
                System.Threading.CancellationToken cancellationToken)
            {
                return MediaDownloader.DownloadAsync(this.GenerateRequestUri(), stream, cancellationToken);
            }

        }
    }

    /// <summary>The "reportTypes" collection of methods.</summary>
    public class ReportTypesResource
    {
        private const string Resource = "reportTypes";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ReportTypesResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Lists report types.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Lists report types.</summary>
        public class ListRequest : YouTubeReportingBaseServiceRequest<Google.Apis.YouTubeReporting.v1.Data.ListReportTypesResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }


            /// <summary>A token identifying a page of results the server should return. Typically, this is the value of
            /// ListReportTypesResponse.next_page_token returned in response to the previous call to the
            /// `ListReportTypes` method.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>If set to true, also system-managed report types will be returned; otherwise only the report
            /// types that can be used to create new reporting jobs will be returned.</summary>
            [Google.Apis.Util.RequestParameterAttribute("includeSystemManaged", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<bool> IncludeSystemManaged { get; set; }

            /// <summary>Requested page size. Server may return fewer report types than requested. If unspecified,
            /// server will pick an appropriate default.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> PageSize { get; set; }

            /// <summary>The content owner's external ID on which behalf the user is acting on. If not set, the user is
            /// acting for himself (his own channel).</summary>
            [Google.Apis.Util.RequestParameterAttribute("onBehalfOfContentOwner", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OnBehalfOfContentOwner { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1/reportTypes"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "includeSystemManaged", new Google.Apis.Discovery.Parameter
                    {
                        Name = "includeSystemManaged",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageSize", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageSize",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "onBehalfOfContentOwner", new Google.Apis.Discovery.Parameter
                    {
                        Name = "onBehalfOfContentOwner",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.YouTubeReporting.v1.Data
{    

    /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
    /// typical example is to use it as the request or the response type of an API method. For instance:
    ///
    /// service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    ///
    /// The JSON representation for `Empty` is empty JSON object `{}`.</summary>
    public class Empty : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A job creating reports of a specific type.</summary>
    public class Job : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The creation date/time of the job.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("createTime")]
        public virtual object CreateTime { get; set; } 

        /// <summary>The date/time when this job will expire/expired. After a job expired, no new reports are
        /// generated.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("expireTime")]
        public virtual object ExpireTime { get; set; } 

        /// <summary>The server-generated ID of the job (max. 40 characters).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>The name of the job (max. 100 characters).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The type of reports this job creates. Corresponds to the ID of a ReportType.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("reportTypeId")]
        public virtual string ReportTypeId { get; set; } 

        /// <summary>True if this a system-managed job that cannot be modified by the user; otherwise false.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("systemManaged")]
        public virtual System.Nullable<bool> SystemManaged { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response message for ReportingService.ListJobs.</summary>
    public class ListJobsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The list of jobs.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("jobs")]
        public virtual System.Collections.Generic.IList<Job> Jobs { get; set; } 

        /// <summary>A token to retrieve next page of results. Pass this value in the ListJobsRequest.page_token field
        /// in the subsequent call to `ListJobs` method to retrieve the next page of results.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response message for ReportingService.ListReportTypes.</summary>
    public class ListReportTypesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A token to retrieve next page of results. Pass this value in the ListReportTypesRequest.page_token
        /// field in the subsequent call to `ListReportTypes` method to retrieve the next page of results.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The list of report types.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("reportTypes")]
        public virtual System.Collections.Generic.IList<ReportType> ReportTypes { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Response message for ReportingService.ListReports.</summary>
    public class ListReportsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A token to retrieve next page of results. Pass this value in the ListReportsRequest.page_token
        /// field in the subsequent call to `ListReports` method to retrieve the next page of results.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The list of report types.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("reports")]
        public virtual System.Collections.Generic.IList<Report> Reports { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Media resource.</summary>
    public class Media : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Name of the media resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resourceName")]
        public virtual string ResourceName { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A report's metadata including the URL from which the report itself can be downloaded.</summary>
    public class Report : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The date/time when this report was created.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("createTime")]
        public virtual object CreateTime { get; set; } 

        /// <summary>The URL from which the report can be downloaded (max. 1000 characters).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("downloadUrl")]
        public virtual string DownloadUrl { get; set; } 

        /// <summary>The end of the time period that the report instance covers. The value is exclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTime")]
        public virtual object EndTime { get; set; } 

        /// <summary>The server-generated ID of the report.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>The date/time when the job this report belongs to will expire/expired.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("jobExpireTime")]
        public virtual object JobExpireTime { get; set; } 

        /// <summary>The ID of the job that created this report.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("jobId")]
        public virtual string JobId { get; set; } 

        /// <summary>The start of the time period that the report instance covers. The value is inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTime")]
        public virtual object StartTime { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A report type.</summary>
    public class ReportType : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The date/time when this report type was/will be deprecated.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("deprecateTime")]
        public virtual object DeprecateTime { get; set; } 

        /// <summary>The ID of the report type (max. 100 characters).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>The name of the report type (max. 100 characters).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>True if this a system-managed report type; otherwise false. Reporting jobs for system-managed
        /// report types are created automatically and can thus not be used in the `CreateJob` method.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("systemManaged")]
        public virtual System.Nullable<bool> SystemManaged { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
